﻿<%@ Control language="C#" Inherits="Authentication.SystemAccount.ViewSystemAccount" CodeFile="ViewSystemAccount.ascx.cs" AutoEventWireup="true"%>
<%@ Register Src="../../controls/tm_userList.ascx" TagName="tm_userList" TagPrefix="uc1" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>

<center>
<asp:Panel ID="pnlResult" runat="server" Width="100%">
    <table border="0" width="100%" class="table">
        <tr>
            <td colspan="3">
                <asp:CheckBox ID="cbxCheckAll" runat="server" OnCheckedChanged="cbxCheckAll_CheckedChanged" AutoPostBack="True" Visible="False" CssClass="titletext3" Text="Chọn tất cả" /></td>
        </tr>
    <tr>
        <td colspan="3">
            <asp:GridView ID="gvResultSearch" runat="server" AutoGenerateColumns="False" 
                DataSourceID="dsResultSearch" AllowPaging="True" 
                OnPageIndexChanging="gvResultSearch_PageIndexChanging" Width="100%" 
                OnDataBound="gvResultSearch_DataBound" AllowSorting="True"
                DataKeyNames="userId" OnSorting="gvResultSearch_Sorting" CssClass="table">
                <Columns>
                    <asp:TemplateField>
                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                        <ItemTemplate>
                            <asp:CheckBox ID="cbxCheck" runat="server" />
                                <asp:Label ID="lblUserId" runat="server" Text='<%# Eval("userId") %>' Visible="False"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="T&#224;i khoản" SortExpression="account">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='<%# getURL(DataBinder.Eval(Container, "DataItem.userId").ToString()) %>'><%# DataBinder.Eval(Container, "DataItem.account") %></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Họ t&#234;n" SortExpression="name1">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name1") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email" SortExpression="email">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <a id="A1" href='mailto:<%# Eval("email") %>'><%# Eval("email") %>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="displayCode" HeaderText="Trạng th&#225;i" SortExpression="displayCode" >
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Ng&#224;y tạo" SortExpression="registerDate">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# ((DateTime)DataBinder.Eval(Container, "DataItem.registerDate")).ToShortDateString() %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
    </table>
    <asp:SqlDataSource ID="dsResultSearch" runat="server"></asp:SqlDataSource>
    </asp:Panel>
    
    <asp:Panel ID="pnlButton" runat="server" Width="100%" Visible="False">
    <table width="100%" class="table">
        <tr>
            <td valign="middle" width="50%" style="height: 26px">
            <asp:Label ID="lblStatus" runat="server" Font-Bold="True" Text="Trạng thái :" CssClass="titletext3"></asp:Label><asp:DropDownList
                ID="ddlSetStatus" runat="server">
                <asp:ListItem Value="ENA">Hoạt động</asp:ListItem>
                <asp:ListItem Value="DIS">Tạm ngưng</asp:ListItem>
            </asp:DropDownList><asp:Button ID="btnAgree" runat="server" Font-Bold="True"
                OnClick="btnAgree_Click" Text="Thiết lập" CssClass="btn" />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            <asp:Button ID="btnDelete" runat="server" Font-Bold="True"
                OnClick="btnDelete_Click" Text="Xóa chọn" CssClass="btn" OnClientClick="return confirm('Xóa các tài khoản đã chọn ?')" /></td>
            <td align="right" style="height: 26px">
            <asp:Button ID="btnExport" runat="server" OnClick="btnExport_Click" Text=" Excel" CssClass="btn" Font-Bold="True" /></td>
        </tr>
    </table>
</asp:Panel>
    </center>
<%--<center>
    <asp:Panel ID="pnlResultSearch" runat="server" Width="100%">
        <table width="100%">
            <tr>
                <td style="width: 3px">
                    <uc1:tm_userList ID="userList" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 3px">
                    <hr />
                </td>
            </tr>
        </table>
    </asp:Panel>
    </center>--%>
<center>
    </center>
<center>
 
<asp:Panel ID="pnlSearch" runat="server" Width="100%">
<table border="0" width="100%" class="table">
    <tr>
        <td style="width: 175px">
            <asp:Label ID="lblAccount" runat="server" Text="Tài khoản :" Font-Bold="True" CssClass="titleText3"></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="tbxAccount" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
            <asp:Label ID="lblUserEmail" runat="server" Text="Email :" Font-Bold="True" CssClass="titleText3"></asp:Label></td>
        <td>
            <asp:TextBox ID="tbxUserEmail" runat="server" Width="265px"></asp:TextBox></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
            <asp:Label ID="lblFullName" runat="server" Font-Bold="True" Text="Họ và tên :" CssClass="titleText3"></asp:Label></td>
        <td>
            <asp:TextBox ID="tbxFullName" runat="server" Width="267px"></asp:TextBox>
            </td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
            </td>
        <td>
            <asp:CheckBox ID="cbxFindExactly" runat="server" Text="Tìm chính xác" /></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
            <asp:Label ID="lblUserStatus" runat="server" Font-Bold="True" Text="Trạng thái :" CssClass="titleText3"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlUserStatus" runat="server" AppendDataBoundItems="True">
            </asp:DropDownList></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px"><asp:CheckBox ID="chkPermission" runat="server" Text="Phân quyền :" AutoPostBack="True" CssClass="titleText3" OnCheckedChanged="chkPermission_CheckedChanged" TextAlign="Left" Font-Bold="True" /></td>
        <td>
            <asp:ListBox ID="lbxAdminRole" runat="server" SelectionMode="Multiple" Width="358px" Enabled="False" Rows="8"></asp:ListBox></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
        </td>
        <td>
            <asp:CheckBox ID="chkAdminRole" runat="server" Text="Quyền quản trị" /></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
        </td>
        <td>
            <asp:Button ID="btnSearch" runat="server" Text="Tìm" Font-Bold="True" OnClick="btnSearch_Click" Width="72px" CssClass="btn" />
            <asp:Button ID="btnClear" runat="server" Font-Bold="True" Text="Làm lại" Width="82px" OnClick="btnClear_Click" CssClass="btn" />
            <asp:Button ID="btnNew" runat="server" Font-Bold="True" Text="Thêm mới" Width="88px" OnClick="btnNew_Click" CssClass="btn" /></td>
    </tr>
    <tr>
        <td style="vertical-align: top; width: 175px; height: 26px">
        </td>
        <td>
            <asp:Label ID="lblNotice" runat="server"></asp:Label></td>
    </tr>
</table>
</asp:Panel>
    </center>
<center>
    &nbsp;<asp:Label ID="lblDebugMessage" runat="server" Visible="False"></asp:Label></center>
